export default (() => {
  // const modulesContext = require.context('./modules', false, /\.js$/)
  const modulesContext = import.meta.glob('./modules/*.js', { eager: true })
  let totalModules = Object.keys(modulesContext).reduce((modules, key) => {
    modules[key.replace(/(^\.\/)|(\.js$)/g, '')] = modulesContext[key].default
    return modules
  }, {})

  let obj =  []
  for (const key in totalModules) {
    obj = { ...obj, ...totalModules[key] }
  }

  return obj
})()
